package sk.octopuss.archery.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import sk.octopuss.archery.domain.Brand;
import sk.octopuss.archery.service.BrandService;

@Component
public class StringToBrandConverter implements Converter<String,Brand>{
	@Autowired
	BrandService brandService;

	@Override
	public Brand convert(final String id) {
	return brandService.find(Long.parseLong(id));
	}
	
}
